import 'package:hooks_riverpod/hooks_riverpod.dart';

const int kDigitalOrder = 2;
const double kRippleDb = 0.01;
const double kSampleRate = 250;

class DigitalModel {
  final int order;
  final double sampleRate;
  final double startFrequency;
  final double endFrequency;
  final double ripple;

  DigitalModel({
    required this.startFrequency,
    required this.endFrequency,
    this.ripple = kRippleDb,
    this.order = kDigitalOrder,
    this.sampleRate = kSampleRate,
  });
}

class DigitalModelConfig {
  final DigitalModel sleepFliter;
  final DigitalModel fatiguFliter;
  final DigitalModel pulseFliter;

  final DigitalModel sleepShowFliter;
  final DigitalModel fatiguShowFliter;
  final DigitalModel pulseShowFliter;
  DigitalModelConfig({
    required this.sleepShowFliter,
    required this.fatiguShowFliter,
    required this.pulseShowFliter,
    required this.sleepFliter,
    required this.fatiguFliter,
    required this.pulseFliter,
  });
}

final digitalFilterProvider = Provider((ref) {
  return DigitalModelConfig(
      sleepShowFliter: DigitalModel(endFrequency: 1, startFrequency: 0.1),
      fatiguShowFliter: DigitalModel(endFrequency: 3.5, startFrequency: 0.1),
      pulseShowFliter: DigitalModel(endFrequency: 3.5, startFrequency: 0.5),
      sleepFliter: DigitalModel(endFrequency: 1, startFrequency: 0.1),
      fatiguFliter: DigitalModel(endFrequency: 3.5, startFrequency: 0.1),
      pulseFliter: DigitalModel(endFrequency: 3.5, startFrequency: 0.01));
});
